/*
 * Copyright (c) 2018.
 * By:kaihangchen
 * E-mail:cmxds@hotmail.com
 */

package cn.cmxds.store.model.Impl;

import android.util.Log;

import com.squareup.okhttp.Response;

import java.util.List;

import cn.cmxds.store.bean.HotResultsBean;
import cn.cmxds.store.http.BaseCallback;
import cn.cmxds.store.http.OkHttpHelper;
import cn.cmxds.store.http.ResultCallBack;
import cn.cmxds.store.model.IHotModel;

public class HotModel implements IHotModel{

    @Override
    public void initRecycleView(final ResultCallBack callBack) {
        OkHttpHelper.getInstance().get("http://www.wanandroid.com/tools/mockapi/9379/ceshihot", new BaseCallback< List< HotResultsBean>>(){

            @Override
            public void onSuccess(Response response, List<HotResultsBean> hotResultsBeans) {
                Log.e("OkHttpHelper","initRecycleView——onSuccess");
                callBack.onResponse(hotResultsBeans);
            }
        });
    }

    @Override
    public void loadMoreRecycleView(final ResultCallBack callBack) {
        OkHttpHelper.getInstance().get("http://www.wanandroid.com/tools/mockapi/9379/ceshihot", new BaseCallback< List< HotResultsBean>>(){

            @Override
            public void onSuccess(Response response, List<HotResultsBean> hotResultsBeans) {
                callBack.onResponse(hotResultsBeans);
            }
        });
    }

    @Override
    public void refreshRecycleView(final ResultCallBack callBack) {
        OkHttpHelper.getInstance().get("http://www.wanandroid.com/tools/mockapi/9379/ceshihot", new BaseCallback< List< HotResultsBean>>(){

            @Override
            public void onSuccess(Response response, List<HotResultsBean> hotResultsBeans) {
                callBack.onResponse(hotResultsBeans);
            }
        });
    }
}
